﻿package com.common.queueloader
{
	import flash.events.Event;
	import flash.net.URLRequest;
	/**
	 *队列加载事件 
	 * @author lake
	 * 
	 */	
	public class QueueLoaderEvent extends Event 
	{

		// Event types
		public static var ITEM_START : String = "itemStart";

		public static var ITEM_PROGRESS : String = "itemProgress";

		public static var ITEM_COMPLETE : String = "itemComplete";

		public static var ITEM_ERROR : String = "itemError";

		public static var ITEM_HTTP_STATUS : String = "itemHTTPStatus";
		
		public static var QUEUE_START : String = "queueStart";

		public static var QUEUE_PROGRESS : String = "queueProgress";

		public static var QUEUE_COMPLETE : String = "queueComplete";


		// Public properties
		public var queueVo:QueueVo;
		
		public var content : *;

		public var fileType : int;

		public var path : URLRequest;

		public var bytesLoaded : Number = 0;

		public var bytesTotal : Number = 0;	

		public var percentage : Number = 0;

		public var queuepercentage : Number = 0;

		public function QueueLoaderEvent( type : String, currItem:*=null, queuepercentage:Number=0) 
		{
			super(type, bubbles, cancelable);
			
			if(currItem != null)
			{
				this.queuepercentage = queuepercentage;
				this.queueVo = (currItem.queueVo == null) ? null : currItem.queueVo;
				this.content = (currItem.content == null) ? null : currItem.content;
				this.path = (currItem.path == "") ? null : currItem.path;
				this.fileType = (currItem.fileType == null) ? null : currItem.fileType;
				this.bytesLoaded = (currItem.bytesLoaded == null) ? null : currItem.bytesLoaded;
				this.bytesTotal = (currItem.bytesTotal == null) ? null : currItem.bytesTotal;
				this.percentage = (currItem.progress == null) ? null : currItem.progress;
			}
			this.queuepercentage = queuepercentage;
		}
	}
}